<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pe="http://primefaces.org/ui/extensions">

	<p:panelGrid columns="4" styleClass="full-width">
		<p:panelGrid columns="1">

			<p:outputLabel for="cmbFilial" value="#{rsc.label_filial}" />

			<p:selectOneMenu style="width: 150px" label="#{rsc.label_filial}"
				styleClass="width: 120px"
				value="#{manterMovimentacaoEstoqueBean.entidade.filial.id}"
				id="cmbFilial">
				<f:selectItems
					value="#{manterMovimentacaoEstoqueBean.formulario.filiais}" var="c"
					itemLabel="#{c.nome}" itemValue="#{c.id}" />
			</p:selectOneMenu>
			<p:outputLabel for="txtNotaFiscalNumero"
				value="#{rsc.label_numeroNotaFiscal}" />

			<p:inputText id="txtNotaFiscalNumero" styleClass="numerico9"
				value="#{manterMovimentacaoEstoqueBean.entidade.notaFiscal.numero}">
				<p:ajax event="blur"
					listener="#{manterMovimentacaoEstoqueBean.validarNotaFiscal}"
					update=":growl"></p:ajax>
			</p:inputText>

		</p:panelGrid>

		<p:panelGrid columns="1">
			<p:outputLabel value="#{rsc.label_dataLancamento}"
				id="lblDataLancamento" for="cldDataLancamento" />
			<p:calendar pattern="dd/MM/yyyy" size="15" showOn="button"
				id="cldDataEmissao"
				value="#{manterMovimentacaoEstoqueBean.entidade.notaFiscal.dataEmissao}" />

			<p:outputLabel for="cmbSerieNF" value="#{rsc.label_serieNF}" />
			<p:selectOneMenu style="width: 150px" label="#{rsc.label_serieNF}"
				styleClass="width: 120px"
				value="#{manterMovimentacaoEstoqueBean.entidade.notaFiscal.serie.id}"
				id="cmbSerieNF">
				<f:selectItem itemLabel="#{rsc.label_selecionar}" itemValue="" />
				<f:selectItems
					value="#{manterMovimentacaoEstoqueBean.formulario.seriesNF}"
					var="c" itemLabel="#{c.nome}" itemValue="#{c.id}" />
				<p:ajax event="change"
					listener="#{manterMovimentacaoEstoqueBean.validarNotaFiscal}"
					update=":growl"></p:ajax>
			</p:selectOneMenu>

		</p:panelGrid>

		<p:panelGrid columns="1">
			<p:outputLabel value="#{rsc.label_dataEmissao}" id="lblDataEmissao"
				for="cldDataEmissao" />
			<p:calendar pattern="dd/MM/yyyy" size="15" showOn="button"
				id="cldDataLancamento"
				value="#{manterMovimentacaoEstoqueBean.entidade.notaFiscal.dataLancamento}" />

			<p:outputLabel for="cmbModeloNF" value="#{rsc.label_modeloNF}" />

			<p:selectOneMenu style="width: 150px" label="#{rsc.label_modeloNF}"
				styleClass="width: 120px"
				value="#{manterMovimentacaoEstoqueBean.entidade.notaFiscal.modelo.id}"
				id="cmbModeloNF">
				<f:selectItem itemLabel="#{rsc.label_selecionar}" itemValue="" />
				<f:selectItems
					value="#{manterMovimentacaoEstoqueBean.formulario.modelosNF}"
					var="c" itemLabel="#{c.nome}" itemValue="#{c.id}" />
			</p:selectOneMenu>

		</p:panelGrid>

		<p:panelGrid columns="1">
			<p:outputLabel value="#{rsc.label_descricao}" id="lblTxtDescricao"
				for="txtDescricao" />
			<p:inputText id="txtDescricao" maxlength="500"
				value="#{manterMovimentacaoEstoqueBean.entidade.descricao}" />

			<p:outputLabel for="cmbNaturezaNF" value="#{rsc.label_naturezaNF}" />

			<p:selectOneMenu style="width: 150px" label="#{rsc.label_naturezaNF}"
				styleClass="width: 120px"
				value="#{manterMovimentacaoEstoqueBean.entidade.notaFiscal.natureza.id}"
				id="cmbNaturezaNF">
				<f:selectItem itemLabel="#{rsc.label_selecionar}" itemValue="" />
				<f:selectItems
					value="#{manterMovimentacaoEstoqueBean.formulario.naturezasNF}"
					var="c" itemLabel="#{c.nome}" itemValue="#{c.id}" />
			</p:selectOneMenu>
		</p:panelGrid>

	</p:panelGrid>

	<p:panelGrid columns="2">
		<p:outputLabel value="#{rsc.label_fornecedor}" for="acFornecedor" />

		<p:panelGrid columns="2">
			<p:autoComplete id="acFornecedor" minQueryLength="3"
				value="#{manterMovimentacaoEstoqueBean.entidade.fornecedor.nome}"
				effect="fade" maxResults="7" disabled="true"
				completeMethod="#{manterMovimentacaoEstoqueBean.autoCompleteNomeFornecedor}" />

			<p:commandButton onstart="dlgFornecedor.show();"
				icon="ui-icon ui-icon-circle-plus" process="@this"
				title="#{rsc.label_buscarFornecedor}">
			</p:commandButton>
		</p:panelGrid>


		<p:outputLabel value="#{rsc.label_transportador}"
			for="acTransportador" />

		<p:panelGrid columns="2">
			<p:autoComplete id="acTransportador" minQueryLength="3"
				value="#{manterMovimentacaoEstoqueBean.entidade.transportador.nome}"
				effect="fade" maxResults="7" disabled="true"
				completeMethod="#{manterMovimentacaoEstoqueBean.autoCompleteNomeTransportador}" />

			<p:commandButton onstart="dlgTransportador.show();"
				icon="ui-icon ui-icon-circle-plus" process="@this"
				title="#{rsc.label_buscarTransportador}">
			</p:commandButton>
		</p:panelGrid>
	</p:panelGrid>

	<p:watermark value="#{rsc.wm_data}" for="cldDataLancamento" />
	<p:watermark value="#{rsc.wm_data}" for="cldDataEmissao" />
	<p:watermark value="#{rsc.wm_descricao}" for="txtDescricao" />
	<p:watermark value="#{rsc.wm_nrNotaFiscal}" for="txtNotaFiscalNumero" />
	<p:watermark value="#{rsc.wm_transportador}" for="acTransportador" />
	<p:watermark value="#{rsc.wm_fornecedor}" for="acFornecedor" />
</ui:composition>
